package com.i2863.receipt.entity;

import com.i2863.receipt.util.BaseEntity;
import lombok.Data;

import javax.persistence.*;

/**
 * 后台管理员账号表
 * Created by Administrator on 2018/6/8.
 */
@Table(name = "d_account")
@Entity
@Data
public class Account extends BaseEntity{

    /**
     * 后台账户用户名
     */
    @Column(name = "username",nullable = false)
    private String username;

    /**
     * 角色 0系统管理员 1站点管理员
     */
    @Column(name = "role",nullable = false)
    private Integer role;


    @Transient
    private String nickName;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name="site_id")
    private Site site;

}
